Skip to content

fix(ui): the related tab's create-only add entry reads New, not Add - #37293

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-37251-related-tab-create-only-new-label
Nov 25, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-37251-related-tab-create-only-new-label

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #37251
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:记录页上主从子对象页签(如客户 → 合同)里那个只能新建的按钮,从「添加」改为「新建」;会弹出选择已有记录的页签仍叫「添加」。
  • 为什么做:主从子对象页签的按钮早已直接打开新建表单,却还叫「添加」,用户以为能关联已有记录(客户 CRM 产品负责人报告的问题)。
  • 出错会怎样:只影响按钮文字,不影响数据;改坏了直接撤回即可。
  • 要你做什么:无。

What changes

ui/packages/plugin-detail/src/RelatedList.tsx, addEntry: the branch with no picker (a master_detail child with no catalog, so derivedAddOf answers nothing and the entry calls onNew) is now labelled t('detail.new') (New / 新建) instead of t('detail.add') (Add / 添加). The picker branch is unchanged: the authored add.label wins, else detail.add. The addFallbackLabel local is gone, since only the picker branch reads detail.add now.

detail.new already exists in the en pack (New), zh-Hans (新建) and DETAIL_DEFAULT_TRANSLATIONS (New), so no locale key is added.

Changeset: @object-ui/plugin-detail patch.

Tests

New top-level describe in the existing addEntry harness, RelatedList.enlargedToolbar-27524.test.tsx (renderList gains an optional language that wraps the tree in I18nProvider):

  • en and zh-CN: a master_detail child with no catalog reads New / 新建, clicking it calls onNew once, and no picker opens.
  • control, en and zh-CN: a lookup child (entry opens a picker) reads Add / 添加 and opens the picker.

Ablation (one-off, not kept): with the no-picker label put back to detail.add via scripts/ablation-replace.mjs, the two New pins failed and the two Add controls passed (Tests 2 failed | 2 passed | 21 skipped). The file was then restored, and the blob matched HEAD (e1f2ad715d08, git diff HEAD empty).

Acceptance notes

Verification

Two-minute check: in ui/, run pnpm exec vitest run packages/plugin-detail/src/__tests__/RelatedList.enlargedToolbar-27524.test.tsx -t 37251. Expected result: 4 passed.

Files to read first:

  1. ui/packages/plugin-detail/src/RelatedList.tsx, the addEntry hunk (the only runtime change).
  2. The new describe at the end of RelatedList.enlargedToolbar-27524.test.tsx.

All readings below were taken at head 9d9bce7.

Package tests and type-check
  • pnpm --filter @object-ui/plugin-detail type-check && pnpm --filter @object-ui/plugin-detail test under the verify lock: VERDICT command-exit 0, Test Files 418 passed | 1 skipped (419), Tests 3953 passed | 18 skipped (3971).
  • Harness plus sibling RelatedList.derivedAddScope-36707.test.tsx: Test Files 2 passed (2), Tests 34 passed (34).
Derived gates
  • node scripts/pm/dispatch-gates.mjs --commands derived 38 commands. All 38 ran and every one exited 0. check:changeset-fixed also ran (exit 0).
  • --ran reconciliation: 38 derived famil(ies) accounted for, 38 run, 0 NOT-MEASURED (a DERIVED zero, all 38 recorded an exit code).
  • CI owns the full farm, including test:repo and the UI lanes.

Generated by Claude Code

Where addEntry has no picker (a master_detail child with no catalog) it
opens the create form, so it is labelled detail.new; a picker keeps
detail.add or the authored add.label. Pinned in en and zh-CN.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QSeKYmRepQK9DkZeU7F53D
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 25, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D

Final head for L1 (p1) · area a4-U · 2026-11-25T13:15Z
Head-sha: 9d9bce739f0be714897e93476898a540534bc70f

Card #37251. Dev report: 7163055624.

  • Fix: addEntry in RelatedList.tsx.

    • When the entry has no picker (a master_detail child with no catalog, which calls onNew), it is labelled t('detail.new'), New / 新建.
    • When it opens a picker, it keeps add.label with the t('detail.add') fallback, Add / 添加.
    • detail.new already exists in the en pack, zh-Hans and DETAIL_DEFAULT_TRANSLATIONS, so no locale key was added.
  • Conflict note, in Acceptance notes: the dispatch said "an explicit add.label still wins". The dev applied that to the picker branch only, where add.label applies today. The no-picker branch never read add.label and still does not, because an authored add label names the pick-existing action and would mislabel a create-only entry.

  • Pins: a new top-level describe in RelatedList.enlargedToolbar-27524.test.tsx, covering en and zh-CN, New on a no-picker tab and Add on a picker tab. renderList gained an optional language that wraps the tree in I18nProvider.

  • Ablation: the no-picker label put back to detail.add. Both New pins go red and both Add controls stay green. Restored to blob == HEAD.

  • Readings, from the dev:

    • plugin-detail 3953 passed, 18 skipped, with type-check exit 0;
    • harness plus derivedAddScope-36707 34 of 34;
    • 38 of 38 dispatch-gates commands exit 0.

    Overlap-check is clean against origin/main, fix(console): a related tab's New keeps the parent it prefills when the child's relationship lookup declares dependsOn #37283, fix(plugin-detail): a related list that already shows 0 keeps showing 0 while it reloads #37220 and feat(spec,console): ask_ai action type — focus the in-app assistant on a record #37215. It ran after the first push rather than before it; nothing was pushed after that.

  • Size: +65 −5 across 3 files, not governed.

  • Check-runs at this head: 42 success, 13 skipped, 0 failing or pending.

  • K: 6.

Handed to the seat session for L1.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — ACCEPT · L1 · head 9d9bce739f0be714897e93476898a540534bc70f · 2026-11-25T13:40Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYmRepQK9DkZeU7F53D

Landing · area a4-U · 2026-11-25T13:44Z · head 9d9bce739f0be714897e93476898a540534bc70f

reading value
L1 ACCEPT 7164123526 (seat repo:objectstack#4) at this head; no must-fix or should-fix, and N1/N2 are optional
check-governed-merges.mjs --pr 37293 NOT governed · 70 changed lines ≤ 3000
check-runs at this head 42 success, 13 expected skip, 0 failed, 0 pending · mergeable_state clean
K 9 (< 15), so no main merge first
overlap-check clean; merge-tree with #37283 is clean in either order (seat)

State change: ready for review, and auto-merge is armed. The queue lands it. On MERGED, #37251 closes through Fixes #37251.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

console: a related tab's one entry reads 「添加」/Add where it can only create (master-detail child, no picker) — label it 「新建」/New

2 participants